#!/usr/bin/python
# -*- coding: UTF-8 -*-

"""
While循环输出乘法表
"""


def while01():
    """
    While循环输出乘法表，效果一
    :return: No
    """
    print("While循环输出乘法表，效果一")
    i = 1
    while i <= 9:
        o = 1
        while o <= i:
            print('{}x{}={:<3}'.format( o, i, i * o), end="")
            o += 1
        print("")
        i += 1
    __lines()


def while02():
    """
    While循环输出乘法表，效果二
    :return: No
    """
    print("While循环输出乘法表，效果二")
    i = 9
    while i >= 1:
        o = 1
        while o <= i:
            print('{}x{}={:<3}'.format(o, i, i * o), end="")
            o += 1
        print("")
        i -= 1
    __lines()


def while03():
    """
    While循环输出乘法表，效果三
    :return: No
    """
    print("While循环输出乘法表，效果三")
    i = 1
    while i <= 9:
        o = i
        ii = 8 - i

        while ii >= 0:
            print(' ' * 6, end=' ')
            ii -= 1
        while o >= 1:
            print('{}x{}={:<3}'.format(o, i, i * o), end="")
            o -= 1
        print('')
        i += 1
    __lines()


def while04():
    """
    While循环输出乘法表，效果四
    :return: No
    """
    print("While循环输出乘法表，效果四")
    i = 9
    while i >= 0:
        o = i
        ii = 8 - i

        while ii >= 0:
            print(' ' * 6, end=' ')
            ii -= 1
        while o >= 1:
            print('{}x{}={:<3}'.format(o, i, i * o), end="")
            o -= 1
        print('')
        i -= 1
    __lines()


def __lines():
    print("="*61)
    input("请按任意键继续操作!")
